import 'package:flutter/material.dart';
import 'package:flutter_learn_demo/sharedata/share_data_widget.dart';
import 'package:flutter_learn_demo/sharedata/share_data_widget_wrap.dart';

class ShareDataWidgetTestCase extends StatefulWidget {

  const ShareDataWidgetTestCase({super.key});

  @override
  State createState() => ShareDataWidgetTestCaseState();

}

class ShareDataWidgetTestCaseState extends State<ShareDataWidgetTestCase> {

  int count = 0;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
     return Center(
       child: ShareDataWidget(
           data: count,
           child: Column(
             mainAxisAlignment: MainAxisAlignment.center,
             children: [
               const Padding(
                   padding: EdgeInsets.all(10),
                   child: ShareDataWidgetWrap(),
               ),
               ElevatedButton(
                   onPressed: () {
                      setState(() {
                         count++;
                      });
                   },
                   child: const Text("Increment")
               ),
             ],
           )
       ),
     );
  }

}